/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entityBeans;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author allankv
 */
@Entity
@Table(name = "originalnameusage")
@NamedQueries({
    @NamedQuery(name = "Originalnameusage.findAll", query = "SELECT o FROM Originalnameusage o"),
    @NamedQuery(name = "Originalnameusage.findByIdoriginalnameusage", query = "SELECT o FROM Originalnameusage o WHERE o.idoriginalnameusage = :idoriginalnameusage"),
    @NamedQuery(name = "Originalnameusage.findByOriginalnameusage", query = "SELECT o FROM Originalnameusage o WHERE o.originalnameusage = :originalnameusage")})
public class Originalnameusage implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idoriginalnameusage")
    private Integer idoriginalnameusage;
    @Column(name = "originalnameusage")
    private String originalnameusage;
    @OneToMany(mappedBy = "originalnameusage", fetch = FetchType.LAZY)
    private List<Taxonomicelement> taxonomicelementList;

    public Originalnameusage() {
    }

    public Originalnameusage(Integer idoriginalnameusage) {
        this.idoriginalnameusage = idoriginalnameusage;
    }

    public Originalnameusage(Integer idoriginalnameusage, String originalnameusage) {
        this.idoriginalnameusage = idoriginalnameusage;
        this.originalnameusage = originalnameusage;
    }

    public Integer getIdoriginalnameusage() {
        return idoriginalnameusage;
    }

    public void setIdoriginalnameusage(Integer idoriginalnameusage) {
        this.idoriginalnameusage = idoriginalnameusage;
    }

    public String getOriginalnameusage() {
        return originalnameusage;
    }

    public void setOriginalnameusage(String originalnameusage) {
        this.originalnameusage = originalnameusage;
    }

    public List<Taxonomicelement> getTaxonomicelementList() {
        return taxonomicelementList;
    }

    public void setTaxonomicelementList(List<Taxonomicelement> taxonomicelementList) {
        this.taxonomicelementList = taxonomicelementList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idoriginalnameusage != null ? idoriginalnameusage.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Originalnameusage)) {
            return false;
        }
        Originalnameusage other = (Originalnameusage) object;
        if ((this.idoriginalnameusage == null && other.idoriginalnameusage != null) || (this.idoriginalnameusage != null && !this.idoriginalnameusage.equals(other.idoriginalnameusage))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entityBeans.Originalnameusage[idoriginalnameusage=" + idoriginalnameusage + "]";
    }

}
